<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        div{
            width: 1200px;
            height: 300px;
            background-color: #ccc;
        }
        div p{
            width: 300px;
            height: 200px;
            background-color: red;
            margin-right: 50px;
            float: left;
        }
        /*700-800*/
        @media screen and (min-width: 700px) and (max-width: 800px) {
            *{
                margin: 0px;
                padding: 0px;
            }
            div{
                width: 700px;
                height: 300px;
                background-color: pink;
            }
            div p{
                width: 150px;
                height: 150px;
                background-color: blue;
            }
        }
        /*400-700*/
        @media screen and (min-width: 400px) and (max-width: 700px) {
            *{
                margin: 0px;
                padding: 0px;
            }
            div{
                width: 400px;
                height: 300px;
                background-color: orange;
            }
            div p{
                width: 100px;
                height: 100px;
                background-color: green;
                margin-right: 10px;
                float: left;
            }
        }
        /*<400*/
        @media screen and (max-width: 400px){
            *{
                margin: 0px;
                padding: 0px;
            }
            div{
                width: 300px;
                height: 300px;
                background-color: purple;
            }
            div p{
                width: 80px;
                height: 80px;
                background-color: yellow;
                margin-right: 5px;
                float: left;
            }
        }
    </style>
</head>
<body>
    <div>
        <p></p>
        <p></p>
        <p></p>
    </div>
</body>
</html>